var banner=document.getElementsByClassName('banner');
var list=document.getElementsByClassName('list');
var dotlist=document.getElementsByClassName('dotlist');
var turn_left=document.getElementById('turn_left');
var turn_right=document.getElementById('turn_right');

var a=0;
function go1() {
	for (var i =0; i <list.length; i++) {
		list[i].style.display='none';
		dotlist[i].style.background='#8B8B8B';
	};
		list[a].style.display='block';
		dotlist[a].style.background='#fff';

	if (a==list.length-1) {
		a=0;
	}else{
		a++;
	};
}
	time =setInterval(go1, 100);
	banner[0].onmouseover=function(){
		clearInterval(time)
	}
	banner[0].onmouseout=function(){
		time=setInterval(go1,500);	
	}
	for (var k=0; k<dotlist.length; k++) {
		run(k);
	};
	function run(k){
		dotlist[k].onclick=function(){
			a=k;
			go1();
		}
	}
	turn_left.onclick=function (){
		if (a==0) {
			a=list.length-2;
		}else if (a==1) {
			a=list.length-1;

		}else{
			a-=2
		}
		go1()
	}
	turn_right.onclick=function(){
		go1()
	}